<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <script src="./jquery-1.12.4.min.js"></script>
    <style>
        .big {
            display: flex;
            justify-content: space-between;
        }

        .big div {
            width: 500px;
            height: 100px;
            margin: 0 20px;
            text-align: center;
            line-height: 100px;
        }

        #a {
            background-color: aquamarine;
        }

        #b {
            background-color: tomato;

        }

        #c {
            background-color: yellowgreen;
        }

        #d {
            background-color: skyblue;

        }

        .p{
            font-weight: 700;
            background-color: pink !important;
        }

        span {
            font-size: 28px;
            font-weight: 700;
            color: black;
            margin: 50px;
        }
    </style>
</head>

<body>
    <div id="box">
        <div class="big">
            <div id="a" @click="fn">首页</div>
            <div id="b" @click="fn">体育</div>
            <div id="c" @click="fn">军事</div>
            <div id="d" @click="fn">生活</div>
        </div>

        <span>{{ nav }}</span>

    </div>


</body>
<script>
    new Vue({
        el: "#box",
        data: {
            nav: "首页",
        },
        methods: {
            fn(e) {
                this.nav = e.target.innerText
                $(e.target).siblings().removeClass()
                $(e.target).addClass('p')
            }
        }
    })
</script>

</html>